From 25dd6e678d52e1bb70375ccb83e442414b3484c0 Mon Sep 17 00:00:00 2001 From: "kfraser@localhost.localdomain" Date: Wed, 16 Aug 2006 18:20:03 +0100 Subject: [PATCH] [XEN] vga code cleanups and additions for other architectures. Based on patches from Hollis Blanchard and Alex Williamson. Signed-off-by: Keir Fraser --- linux-2.6-xen-sparse/arch/ia64/dig/setup.c | 110 +++++++++++ xen/arch/ia64/Rules.mk | 1 + xen/arch/ia64/xen/domain.c | 17 +- xen/arch/ia64/xen/mm.c | 5 + xen/arch/x86/Rules.mk | 1 + xen/arch/x86/mm.c | 15 ++ xen/drivers/Makefile | 2 +- xen/drivers/char/console.c | 147 +------------- xen/{include/xen => drivers/video}/font.h | 0 xen/drivers/video/font_8x14.c | 2 +- xen/drivers/video/font_8x16.c | 2 +- xen/drivers/video/font_8x8.c | 2 +- xen/drivers/video/vga.c | 212 +++++++++++++++++---- xen/include/asm-ia64/config.h | 2 + xen/include/asm-x86/config.h | 2 + xen/include/asm-x86/io.h | 1 + xen/include/xen/mm.h | 3 + xen/include/xen/vga.h | 14 +- 18 files changed, 344 insertions(+), 194 deletions(-) create mode 100644 linux-2.6-xen-sparse/arch/ia64/dig/setup.c rename xen/{include/xen => drivers/video}/font.h (100%) diff --git a/linux-2.6-xen-sparse/arch/ia64/dig/setup.c b/linux-2.6-xen-sparse/arch/ia64/dig/setup.c new file mode 100644 index 0000000000..ebe45c7950 --- /dev/null +++ b/linux-2.6-xen-sparse/arch/ia64/dig/setup.c @@ -0,0 +1,110 @@ +/* + * Platform dependent support for DIG64 platforms. + * + * Copyright (C) 1999 Intel Corp. + * Copyright (C) 1999, 2001 Hewlett-Packard Co + * Copyright (C) 1999, 2001, 2003 David Mosberger-Tang + * Copyright (C) 1999 VA Linux Systems + * Copyright (C) 1999 Walt Drummond + * Copyright (C) 1999 Vijay Chander + */ +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +void __init +dig_setup (char **cmdline_p) +{ + unsigned int orig_x, orig_y, num_cols, num_rows, font_height; + + /* + * Default to /dev/sda2. This assumes that the EFI partition + * is physical disk 1 partition 1 and the Linux root disk is + * physical disk 1 partition 2. + */ + ROOT_DEV = Root_SDA2; /* default to second partition on first drive */ + +#ifdef CONFIG_SMP + init_smp_config(); +#endif + + memset(&screen_info, 0, sizeof(screen_info)); + + if (!ia64_boot_param->console_info.num_rows + || !ia64_boot_param->console_info.num_cols) + { + printk(KERN_WARNING "dig_setup: warning: invalid screen-info, guessing 80x25\n"); + orig_x = 0; + orig_y = 0; + num_cols = 80; + num_rows = 25; + font_height = 16; + } else { + orig_x = ia64_boot_param->console_info.orig_x; + orig_y = ia64_boot_param->console_info.orig_y; + num_cols = ia64_boot_param->console_info.num_cols; + num_rows = ia64_boot_param->console_info.num_rows; + font_height = 400 / num_rows; + } + + screen_info.orig_x = orig_x; + screen_info.orig_y = orig_y; + screen_info.orig_video_cols = num_cols; + screen_info.orig_video_lines = num_rows; + screen_info.orig_video_points = font_height; + screen_info.orig_video_mode = 3; /* XXX fake */ + screen_info.orig_video_isVGA = 1; /* XXX fake */ + screen_info.orig_video_ega_bx = 3; /* XXX fake */ +#ifdef CONFIG_XEN + if (!is_running_on_xen()) + return; + + if (xen_start_info->console.dom0.info_size >= + sizeof(struct dom0_vga_console_info)) { + const struct dom0_vga_console_info *info = + (struct dom0_vga_console_info *)( + (char *)xen_start_info + + xen_start_info->console.dom0.info_off); + screen_info.orig_video_mode = info->txt_mode; + screen_info.orig_video_isVGA = info->video_type; + screen_info.orig_video_lines = info->video_height; + screen_info.orig_video_cols = info->video_width; + screen_info.orig_video_points = info->txt_points; + screen_info.lfb_width = info->video_width; + screen_info.lfb_height = info->video_height; + screen_info.lfb_depth = info->lfb_depth; + screen_info.lfb_base = info->lfb_base; + screen_info.lfb_size = info->lfb_size; + screen_info.lfb_linelength = info->lfb_linelen; + screen_info.red_size = info->red_size; + screen_info.red_pos = info->red_pos; + screen_info.green_size = info->green_size; + screen_info.green_pos = info->green_pos; + screen_info.blue_size = info->blue_size; + screen_info.blue_pos = info->blue_pos; + screen_info.rsvd_size = info->rsvd_size; + screen_info.rsvd_pos = info->rsvd_pos; + } + screen_info.orig_y = screen_info.orig_video_lines - 1; + xen_start_info->console.domU.mfn = 0; + xen_start_info->console.domU.evtchn = 0; +#endif +} + +void __init +dig_irq_init (void) +{ +} diff --git a/xen/arch/ia64/Rules.mk b/xen/arch/ia64/Rules.mk index 030a9e2f1d..3c8663c90b 100644 --- a/xen/arch/ia64/Rules.mk +++ b/xen/arch/ia64/Rules.mk @@ -2,6 +2,7 @@ # ia64-specific definitions HAS_ACPI := y +HAS_VGA := y VALIDATE_VT ?= n no_warns ?= n diff --git a/xen/arch/ia64/xen/domain.c b/xen/arch/ia64/xen/domain.c index 55ce4b7868..9fbcec8a71 100644 --- a/xen/arch/ia64/xen/domain.c +++ b/xen/arch/ia64/xen/domain.c @@ -864,6 +864,7 @@ int construct_dom0(struct domain *d, { int i, rc; start_info_t *si; + dom0_vga_console_info_t *ci; struct vcpu *v = d->vcpu[0]; unsigned long max_pages; @@ -1000,6 +1001,9 @@ int construct_dom0(struct domain *d, //if ( initrd_len != 0 ) // memcpy((void *)vinitrd_start, initrd_start, initrd_len); + BUILD_BUG_ON(sizeof(start_info_t) + sizeof(dom0_vga_console_info_t) + + sizeof(struct ia64_boot_param) > PAGE_SIZE); + /* Set up start info area. */ d->shared_info->arch.start_info_pfn = pstart_info >> PAGE_SHIFT; start_info_page = assign_new_domain_page(d, pstart_info); @@ -1034,7 +1038,8 @@ int construct_dom0(struct domain *d, strncpy((char *)si->cmd_line, dom0_command_line, sizeof(si->cmd_line)); si->cmd_line[sizeof(si->cmd_line)-1] = 0; - bp = (struct ia64_boot_param *)(si + 1); + bp = (struct ia64_boot_param *)((unsigned char *)si + + sizeof(start_info_t)); bp->command_line = pstart_info + offsetof (start_info_t, cmd_line); /* We assume console has reached the last line! */ @@ -1048,6 +1053,16 @@ int construct_dom0(struct domain *d, (PAGE_ALIGN(ia64_boot_param->initrd_size) + 4*1024*1024); bp->initrd_size = ia64_boot_param->initrd_size; + ci = (dom0_vga_console_info_t *)((unsigned char *)si + + sizeof(start_info_t) + + sizeof(struct ia64_boot_param)); + + if (fill_console_start_info(ci)) { + si->console.dom0.info_off = sizeof(start_info_t) + + sizeof(struct ia64_boot_param); + si->console.dom0.info_size = sizeof(dom0_vga_console_info_t); + } + vcpu_init_regs (v); vcpu_regs(v)->r28 = bp_mpa; diff --git a/xen/arch/ia64/xen/mm.c b/xen/arch/ia64/xen/mm.c index ec4927f36b..de19576570 100644 --- a/xen/arch/ia64/xen/mm.c +++ b/xen/arch/ia64/xen/mm.c @@ -1746,6 +1746,11 @@ int get_page_type(struct page_info *page, u32 type) return 1; } +int memory_is_conventional_ram(paddr_t p) +{ + return (efi_mem_type(p) == EFI_CONVENTIONAL_MEMORY); +} + /* * Local variables: * mode: C diff --git a/xen/arch/x86/Rules.mk b/xen/arch/x86/Rules.mk index 399a1cce4b..e91c8bf02d 100644 --- a/xen/arch/x86/Rules.mk +++ b/xen/arch/x86/Rules.mk @@ -2,6 +2,7 @@ # x86-specific definitions HAS_ACPI := y +HAS_VGA := y # # If you change any of these configuration options then you must diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c index 6c0abad2e2..7cf9ce924a 100644 --- a/xen/arch/x86/mm.c +++ b/xen/arch/x86/mm.c @@ -234,6 +234,21 @@ void arch_init_memory(void) subarch_init_memory(); } +int memory_is_conventional_ram(paddr_t p) +{ + int i; + + for ( i = 0; i < e820.nr_map; i++ ) + { + if ( (e820.map[i].type == E820_RAM) && + (e820.map[i].addr <= p) && + (e820.map[i].size > p) ) + return 1; + } + + return 0; +} + void share_xen_page_with_guest( struct page_info *page, struct domain *d, int readonly) { diff --git a/xen/drivers/Makefile b/xen/drivers/Makefile index 1d4c93fbbb..d622373c11 100644 --- a/xen/drivers/Makefile +++ b/xen/drivers/Makefile @@ -1,3 +1,3 @@ subdir-y += char subdir-$(HAS_ACPI) += acpi -subdir-y += video +subdir-$(HAS_VGA) += video diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c index 974f6e3d8e..f516230c29 100644 --- a/xen/drivers/char/console.c +++ b/xen/drivers/char/console.c @@ -22,7 +22,6 @@ #include #include #include -#include #include #include #include @@ -32,10 +31,6 @@ static char opt_console[30] = OPT_CONSOLE_STR; string_param("console", opt_console); -/* vga: comma-separated options. */ -static char opt_vga[30] = ""; -string_param("vga", opt_vga); - /* conswitch: a character pair controlling console switching. */ /* Char 1: CTRL+ is used to switch console input between Xen and DOM0 */ /* Char 2: If this character is 'x', then do not auto-switch to DOM0 when it */ @@ -47,9 +42,6 @@ string_param("conswitch", opt_conswitch); static int opt_sync_console; boolean_param("sync_console", opt_sync_console); -static int xpos, ypos; -static unsigned char *video; - #define CONRING_SIZE 16384 #define CONRING_IDX_MASK(i) ((i)&(CONRING_SIZE-1)) static char conring[CONRING_SIZE]; @@ -58,135 +50,9 @@ static unsigned int conringc, conringp; static char printk_prefix[16] = ""; static int sercon_handle = -1; -static int vgacon_enabled = 0; -static int vgacon_keep = 0; -static int vgacon_lines = 25; -static const struct font_desc *font; static DEFINE_SPINLOCK(console_lock); -/* - * ******************************************************* - * *************** OUTPUT TO VGA CONSOLE ***************** - * ******************************************************* - */ - -/* VGA text-mode definitions. */ -#define COLUMNS 80 -#define LINES vgacon_lines -#define ATTRIBUTE 7 -#define VIDEO_SIZE (COLUMNS * LINES * 2) - -/* Clear the screen and initialize VIDEO, XPOS and YPOS. */ -static void cls(void) -{ - memset(video, 0, VIDEO_SIZE); - xpos = ypos = 0; - vga_cursor_off(); -} - -static void init_vga(void) -{ - char *p; - - if ( !vgacon_enabled ) - return; - - for ( p = opt_vga; p != NULL; p = strchr(p, ',') ) - { - if ( *p == ',' ) - p++; - if ( strncmp(p, "keep", 4) == 0 ) - vgacon_keep = 1; - else if ( strncmp(p, "text-80x", 8) == 0 ) - vgacon_lines = simple_strtoul(p + 8, NULL, 10); - } - - video = setup_vga(); - if ( !video ) - { - vgacon_enabled = 0; - return; - } - - switch ( vgacon_lines ) - { - case 25: - case 30: - font = &font_vga_8x16; - break; - case 28: - case 34: - font = &font_vga_8x14; - break; - case 43: - case 50: - case 60: - font = &font_vga_8x8; - break; - default: - vgacon_lines = 25; - break; - } - - if ( (font != NULL) && (vga_load_font(font, vgacon_lines) < 0) ) - { - vgacon_lines = 25; - font = NULL; - } - - cls(); -} - -static void put_newline(void) -{ - xpos = 0; - ypos++; - - if ( ypos >= LINES ) - { - ypos = LINES-1; - memmove((char*)video, - (char*)video + 2*COLUMNS, (LINES-1)*2*COLUMNS); - memset((char*)video + (LINES-1)*2*COLUMNS, 0, 2*COLUMNS); - } -} - -static void putchar_console(int c) -{ - if ( !vgacon_enabled ) - return; - - if ( c == '\n' ) - { - put_newline(); - } - else - { - if ( xpos >= COLUMNS ) - put_newline(); - video[(xpos + ypos * COLUMNS) * 2] = c & 0xFF; - video[(xpos + ypos * COLUMNS) * 2 + 1] = ATTRIBUTE; - ++xpos; - } -} - -int fill_console_start_info(struct dom0_vga_console_info *ci) -{ - memset(ci, 0, sizeof(*ci)); - - if ( !vgacon_enabled ) - return 0; - - ci->video_type = 1; - ci->video_width = COLUMNS; - ci->video_height = LINES; - ci->txt_mode = 3; - ci->txt_points = font ? font->height : 16; - - return 1; -} - /* * ******************************************************** * *************** ACCESS TO CONSOLE RING ***************** @@ -328,7 +194,7 @@ static long guest_console_write(XEN_GUEST_HANDLE(char) buffer, int count) serial_puts(sercon_handle, kbuf); for ( kptr = kbuf; *kptr != '\0'; kptr++ ) - putchar_console(*kptr); + vga_putchar(*kptr); guest_handle_add_offset(buffer, kcount); count -= kcount; @@ -395,7 +261,7 @@ static inline void __putstr(const char *str) while ( (c = *str++) != '\0' ) { - putchar_console(c); + vga_putchar(c); putchar_console_ring(c); } } @@ -455,11 +321,9 @@ void init_console(void) if ( strncmp(p, "com", 3) == 0 ) sercon_handle = serial_parse_handle(p); else if ( strncmp(p, "vga", 3) == 0 ) - vgacon_enabled = 1; + vga_init(); } - init_vga(); - serial_set_rx_handler(sercon_handle, serial_rx); /* HELLO WORLD --- start-of-day banner text. */ @@ -510,10 +374,7 @@ void console_endboot(void) printk("\n"); } - if ( !vgacon_keep ) - vgacon_enabled = 0; - printk("Xen is %s VGA console.\n", - vgacon_keep ? "keeping" : "relinquishing"); + vga_endboot(); /* * If user specifies so, we fool the switch routine to redirect input diff --git a/xen/include/xen/font.h b/xen/drivers/video/font.h similarity index 100% rename from xen/include/xen/font.h rename to xen/drivers/video/font.h diff --git a/xen/drivers/video/font_8x14.c b/xen/drivers/video/font_8x14.c index 022c809b1e..6a39f263af 100644 --- a/xen/drivers/video/font_8x14.c +++ b/xen/drivers/video/font_8x14.c @@ -5,7 +5,7 @@ /**********************************************/ #include -#include +#include "font.h" #define FONTDATAMAX (256*14) diff --git a/xen/drivers/video/font_8x16.c b/xen/drivers/video/font_8x16.c index 756f44f218..c65f98dcbb 100644 --- a/xen/drivers/video/font_8x16.c +++ b/xen/drivers/video/font_8x16.c @@ -5,7 +5,7 @@ /**********************************************/ #include -#include +#include "font.h" #define FONTDATAMAX (256*16) diff --git a/xen/drivers/video/font_8x8.c b/xen/drivers/video/font_8x8.c index e84d8094f0..9441429b42 100644 --- a/xen/drivers/video/font_8x8.c +++ b/xen/drivers/video/font_8x8.c @@ -5,7 +5,7 @@ /**********************************************/ #include -#include +#include "font.h" #define FONTDATAMAX (256*8) diff --git a/xen/drivers/video/vga.c b/xen/drivers/video/vga.c index 78cfae8eda..b22e0fa12d 100644 --- a/xen/drivers/video/vga.c +++ b/xen/drivers/video/vga.c @@ -8,13 +8,14 @@ #include #include #include +#include #include #include #include #include -#include #include #include +#include "font.h" /* Some of the code below is taken from SVGAlib. The original, unmodified copyright notice for that code is below. */ @@ -159,12 +160,8 @@ * into a single 16-bit quantity */ #define VGA_OUT16VAL(v, r) (((v) << 8) | (r)) -#if defined(__i386__) || defined(__x86_64__) -# define vgabase 0 -# define VGA_OUTW_WRITE -# define vga_readb(x) (*(x)) -# define vga_writeb(x,y) (*(y) = (x)) -#endif +#define vgabase 0 /* use in/out port-access macros */ +#define VGA_OUTW_WRITE /* can use outw instead of 2xoutb */ /* * generic VGA port read/write @@ -187,17 +184,17 @@ static inline void vga_io_w_fast(uint16_t port, uint8_t reg, uint8_t val) static inline uint8_t vga_mm_r(void __iomem *regbase, uint16_t port) { - return readb(regbase + port); + return readb((char *)regbase + port); } static inline void vga_mm_w(void __iomem *regbase, uint16_t port, uint8_t val) { - writeb(val, regbase + port); + writeb(val, (char *)regbase + port); } static inline void vga_mm_w_fast(void __iomem *regbase, uint16_t port, uint8_t reg, uint8_t val) { - writew(VGA_OUT16VAL(val, reg), regbase + port); + writew(VGA_OUT16VAL(val, reg), (char *)regbase + port); } static inline uint8_t vga_r(void __iomem *regbase, uint16_t port) @@ -324,24 +321,8 @@ static int detect_video(void *video_base) return video_found; } -static int detect_vga(void) -{ - /* - * Look at a number of well-known locations. Even if video is not at - * 0xB8000 right now, it will appear there when we set up text mode 3. - * - * We assume if there is any sign of a video adaptor then it is at least - * VGA-compatible (surely noone runs CGA, EGA, .... these days?). - * - * These checks are basically to detect headless server boxes. - */ - return (detect_video(ioremap(0xA0000, 0x1000)) || - detect_video(ioremap(0xB0000, 0x1000)) || - detect_video(ioremap(0xB8000, 0x1000))); -} - /* This is actually code from vgaHWRestore in an old version of XFree86 :-) */ -void *setup_vga(void) +static void *setup_vga(void) { /* The following VGA state was saved from a chip in text mode 3. */ static unsigned char regs[] = { @@ -358,13 +339,11 @@ void *setup_vga(void) 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, 0x0c, 0x00, 0x0f, 0x08, 0x00 }; + char *video; int i, j; - if ( !detect_vga() ) - { - printk("No VGA adaptor detected!\n"); - return NULL; - } + if ( memory_is_conventional_ram(0xB8000) ) + goto no_vga; inb(VGA_IS1_RC); outb(0x00, VGA_ATT_IW); @@ -388,12 +367,19 @@ void *setup_vga(void) inb(VGA_IS1_RC); outb(0x20, VGA_ATT_IW); - return ioremap(0xB8000, 0x8000); -} + video = ioremap(0xB8000, 0x8000); -void vga_cursor_off(void) -{ - vga_wcrt(vgabase, VGA_CRTC_CURSOR_START, 0x20); + if ( !detect_video(video) ) + { + iounmap(video); + goto no_vga; + } + + return video; + + no_vga: + printk("No VGA adaptor detected!\n"); + return NULL; } static int vga_set_scanlines(unsigned scanlines) @@ -473,7 +459,7 @@ static int vga_set_scanlines(unsigned scanlines) static unsigned font_slot = 0; integer_param("fontslot", font_slot); -int vga_load_font(const struct font_desc *font, unsigned rows) +static int vga_load_font(const struct font_desc *font, unsigned rows) { unsigned fontheight = font ? font->height : 16; uint8_t fsr = vga_rcrt(vgabase, VGA_CRTC_MAX_SCAN); /* Font size register */ @@ -515,16 +501,19 @@ int vga_load_font(const struct font_desc *font, unsigned rows) { unsigned i, j; const uint8_t *data = font->data; - uint8_t *map = (uint8_t *)__va(0xA0000) + font_slot*2*CHAR_MAP_SIZE; + uint8_t *map; + + map = ioremap(0xA0000 + font_slot*2*CHAR_MAP_SIZE, CHAR_MAP_SIZE); for ( i = j = 0; i < CHAR_MAP_SIZE; ) { - vga_writeb(j < font->count * fontheight ? data[j++] : 0, - map + i++); + writeb(j < font->count * fontheight ? data[j++] : 0, map + i++); if ( !(j % fontheight) ) while ( i & (FONT_HEIGHT_MAX - 1) ) - vga_writeb(0, map + i++); + writeb(0, map + i++); } + + iounmap(map); } /* First, the sequencer, Synchronous reset */ @@ -560,3 +549,142 @@ int vga_load_font(const struct font_desc *font, unsigned rows) return 0; } + + +/* + * HIGH-LEVEL INITIALISATION AND TEXT OUTPUT. + */ + +static int vgacon_enabled = 0; +static int vgacon_keep = 0; +static int vgacon_lines = 25; +static const struct font_desc *font; + +static int xpos, ypos; +static unsigned char *video; + +/* vga: comma-separated options. */ +static char opt_vga[30] = ""; +string_param("vga", opt_vga); + +/* VGA text-mode definitions. */ +#define COLUMNS 80 +#define LINES vgacon_lines +#define ATTRIBUTE 7 +#define VIDEO_SIZE (COLUMNS * LINES * 2) + +void vga_init(void) +{ + char *p; + + for ( p = opt_vga; p != NULL; p = strchr(p, ',') ) + { + if ( *p == ',' ) + p++; + if ( strncmp(p, "keep", 4) == 0 ) + vgacon_keep = 1; + else if ( strncmp(p, "text-80x", 8) == 0 ) + vgacon_lines = simple_strtoul(p + 8, NULL, 10); + } + + video = setup_vga(); + if ( !video ) + return; + + switch ( vgacon_lines ) + { + case 25: + case 30: + font = &font_vga_8x16; + break; + case 28: + case 34: + font = &font_vga_8x14; + break; + case 43: + case 50: + case 60: + font = &font_vga_8x8; + break; + default: + vgacon_lines = 25; + break; + } + + if ( (font != NULL) && (vga_load_font(font, vgacon_lines) < 0) ) + { + vgacon_lines = 25; + font = NULL; + } + + /* Clear the screen. */ + memset(video, 0, VIDEO_SIZE); + xpos = ypos = 0; + + /* Disable cursor. */ + vga_wcrt(vgabase, VGA_CRTC_CURSOR_START, 0x20); + + vgacon_enabled = 1; +} + +void vga_endboot(void) +{ + if ( !vgacon_enabled ) + return; + + if ( !vgacon_keep ) + vgacon_enabled = 0; + + printk("Xen is %s VGA console.\n", + vgacon_keep ? "keeping" : "relinquishing"); +} + + +static void put_newline(void) +{ + xpos = 0; + ypos++; + + if ( ypos >= LINES ) + { + ypos = LINES-1; + memmove((char*)video, + (char*)video + 2*COLUMNS, (LINES-1)*2*COLUMNS); + memset((char*)video + (LINES-1)*2*COLUMNS, 0, 2*COLUMNS); + } +} + +void vga_putchar(int c) +{ + if ( !vgacon_enabled ) + return; + + if ( c == '\n' ) + { + put_newline(); + } + else + { + if ( xpos >= COLUMNS ) + put_newline(); + video[(xpos + ypos * COLUMNS) * 2] = c & 0xFF; + video[(xpos + ypos * COLUMNS) * 2 + 1] = ATTRIBUTE; + ++xpos; + } +} + +int fill_console_start_info(struct dom0_vga_console_info *ci) +{ + memset(ci, 0, sizeof(*ci)); + + if ( !vgacon_enabled ) + return 0; + + ci->video_type = 1; + ci->video_width = COLUMNS; + ci->video_height = LINES; + ci->txt_mode = 3; + ci->txt_points = font ? font->height : 16; + + return 1; +} diff --git a/xen/include/asm-ia64/config.h b/xen/include/asm-ia64/config.h index 12d48f7baf..4d172c5277 100644 --- a/xen/include/asm-ia64/config.h +++ b/xen/include/asm-ia64/config.h @@ -37,6 +37,8 @@ #define MAX_DMADOM_PFN (0x7FFFFFFFUL >> PAGE_SHIFT) /* 31 addressable bits */ +#define CONFIG_VGA 1 + #ifndef __ASSEMBLY__ // can't find where this typedef was before?!? diff --git a/xen/include/asm-x86/config.h b/xen/include/asm-x86/config.h index 74a123de6f..e2ef90700c 100644 --- a/xen/include/asm-x86/config.h +++ b/xen/include/asm-x86/config.h @@ -31,6 +31,8 @@ #define CONFIG_ACPI 1 #define CONFIG_ACPI_BOOT 1 +#define CONFIG_VGA 1 + #define HZ 100 #define OPT_CONSOLE_STR "com1,vga" diff --git a/xen/include/asm-x86/io.h b/xen/include/asm-x86/io.h index d393c1b606..968e7d35ce 100644 --- a/xen/include/asm-x86/io.h +++ b/xen/include/asm-x86/io.h @@ -7,6 +7,7 @@ /* We don't need real ioremap() on Xen/x86. */ #define ioremap(x,l) (__va(x)) +#define iounmap(p) ((void)0) #define readb(x) (*(volatile char *)(x)) #define readw(x) (*(volatile short *)(x)) diff --git a/xen/include/xen/mm.h b/xen/include/xen/mm.h index d38fbed09e..8c9713971b 100644 --- a/xen/include/xen/mm.h +++ b/xen/include/xen/mm.h @@ -97,4 +97,7 @@ unsigned long avail_scrub_pages(void); int guest_remove_page(struct domain *d, unsigned long gmfn); +/* Returns TRUE if the memory at address @p is ordinary RAM. */ +int memory_is_conventional_ram(paddr_t p); + #endif /* __XEN_MM_H__ */ diff --git a/xen/include/xen/vga.h b/xen/include/xen/vga.h index 9284b71822..3431d625f7 100644 --- a/xen/include/xen/vga.h +++ b/xen/include/xen/vga.h @@ -9,10 +9,16 @@ #ifndef _XEN_VGA_H #define _XEN_VGA_H -struct font_desc; +#include -void *setup_vga(void); -void vga_cursor_off(void); -int vga_load_font(const struct font_desc *, unsigned rows); +#ifdef CONFIG_VGA +void vga_init(void); +void vga_endboot(void); +void vga_putchar(int c); +#else +#define vga_init() ((void)0) +#define vga_endboot() ((void)0) +#define vga_putchar(c) ((void)0) +#endif #endif /* _XEN_VGA_H */ -- 2.30.2